/*
 * Edge.cpp
 *
 *  Created on: May 12, 2011
 *      Author: ei07121
 */



#include "Edge.h"


 Edge::Edge(string n, string cr, int id, int c, Vertex i, Vertex f):nome(n), cor(cr), idEdge(id), custo(c), v_inicio(i), v_fim(f){}


int Edge::getCusto() const
{
    return custo;
}

Vertex Edge::getFim() const
{
    return v_fim;
}

int Edge::getIdEdge() const
{
    return idEdge;
}

Vertex Edge::getInicio() const
{
    return v_inicio;
}

void Edge::setCusto(int custo)
{
    this->custo = custo;
}

void Edge::setFim(Vertex v_fim)
{
    this->v_fim = v_fim;
}

void Edge::setIdEdge(int idEdge)
{
    this->idEdge = idEdge;
}

string Edge::getCor() const
{
    return cor;
}

string Edge::getNome() const
{
    return nome;
}

void Edge::setCor(string cor)
{
    this->cor = cor;
}

void Edge::setNome(string nome)
{
    this->nome = nome;
}

void Edge::setInicio(Vertex v_inicio)
{
    this->v_inicio = v_inicio;
}


Vertex Edge::findNext(Vertex v)
{
       if(this->v_inicio.getId() == v.getId())
               return this->v_fim;
       if(this->v_fim.getId() == v.getId())
               return this->v_inicio;
}


